package com.zhang.order.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;

import java.io.Serializable;

/**
 * 评价与文件关联表（用户上传评价内容）
 * @TableName appraise_file
 */
@TableName(value ="appraise_file")
@AllArgsConstructor
public class AppraiseFile implements Serializable {
    /**
     * 评价表id
     */
    private Integer appraiseId;

    /**
     * 文件id
     */
    private Integer fileId;

    /**
     * 文件类型
     */
    private String fileType;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 评价表id
     */
    public Integer getAppraiseId() {
        return appraiseId;
    }

    /**
     * 评价表id
     */
    public void setAppraiseId(Integer appraiseId) {
        this.appraiseId = appraiseId;
    }

    /**
     * 文件id
     */
    public Integer getFileId() {
        return fileId;
    }

    /**
     * 文件id
     */
    public void setFileId(Integer fileId) {
        this.fileId = fileId;
    }

    /**
     * 文件类型
     */
    public String getFileType() {
        return fileType;
    }

    /**
     * 文件类型
     */
    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AppraiseFile other = (AppraiseFile) that;
        return (this.getAppraiseId() == null ? other.getAppraiseId() == null : this.getAppraiseId().equals(other.getAppraiseId()))
            && (this.getFileId() == null ? other.getFileId() == null : this.getFileId().equals(other.getFileId()))
            && (this.getFileType() == null ? other.getFileType() == null : this.getFileType().equals(other.getFileType()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAppraiseId() == null) ? 0 : getAppraiseId().hashCode());
        result = prime * result + ((getFileId() == null) ? 0 : getFileId().hashCode());
        result = prime * result + ((getFileType() == null) ? 0 : getFileType().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", appraiseId=").append(appraiseId);
        sb.append(", fileId=").append(fileId);
        sb.append(", fileType=").append(fileType);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
